package com.dlc.shop.bean.enums;


/**
 * 满减规则
 *
 */
/**
 * @author Yami
 */
public enum FormItemEnum {
    /** 客单价 (支付金额/支付人数)*/
    CUSTOMER_UNIT_PRICE(1,"客单价","Customer Unit Price",0, "yami.form.item.customerPrice"),

    /** 总成交金额 */
    TOTAL_TRANSACTION_AMOUNT(2,"总成交金额","Total transaction amount",0, "yami.form.item.totalAmount"),

    /** 自营客单价 (自营金额/自营人数) */
    SELF_OPERATED_CUSTOMER_UNIT_PRICE(3,"自营客单价","Self-employed customer unit price",1, "yami.form.item.selfCustomerPrice"),

    /** 自营金额 */
    SELF_OPERATED_AMOUNT(4,"自营金额","Self-employed amount",1, "yami.form.item.selfAmount"),

    /** 自营订单数 */
    SELF_OPERATED_ORDER_NUMS(5,"自营订单数","Number of self-operated orders",1, "yami.form.item.selfOrderNums"),

    /** 自营商品数 */
    SELF_OPERATED_PRODUCT_NUMS(6,"自营商品数","Number of self-operated products",1, "yami.form.item.selfProductNums"),
    /** 自营下单人数 */
    SELF_OPERATED_NUMS(7,"自营下单人数","Number of self-operated orders",1, "yami.form.item.operatorNums"),

    /** 下单金额 */
    ORDER_AMOUNT(8,"下单金额","Order amount",0, "yami.form.item.orderAmount"),

    /** 下单人数 */
    USER_NUMS(9,"下单人数", "Number of people placing orders",0, "yami.form.item.userNums"),

    /** 下单笔数 */
    ORDER_NUMS(10,"下单笔数","Number of orders",0, "yami.form.item.orderNums"),

    /** 下单商品数 */
    PRODUCT_NUMS(11,"下单商品数","Number of products ordered",0, "yami.form.item.productNums"),

    /** 支付金额 */
    PAY_AMOUNT(12,"支付金额","Payment amount",0, "yami.form.item.payAmount"),

    /** 支付人数 */
    PAY_USER_NUMS(13,"支付人数","Number of people paid",0, "yami.form.item.payUserNums"),

    /** 支付订单数 */
    PAY_ORDER_NUMS(14,"支付订单数","Number of paid orders",0, "yami.form.item.payOrderNums"),

    /** 支付商品数 */
    PAY_PRODUCT_NUMS(15,"支付商品数","Number of paid products",0, "yami.form.item.payProductNums"),

    /** 成功退款金额 */
    SUCCESS_REFUND_AMOUNT(16,"成功退款金额","Successful refund amount",0, "yami.form.item.successRefundAmount"),

    /** 退款订单数量 */
    REFUND_ORDER_NUMS(17,"退款订单数量","Number of refund orders",0, "yami.form.item.refundOrderNums"),

    /** 下单-支付转化率 （支付订单数量/下单订单数量）*/
    ORDER_TO_PAY_RATE(18,"下单-支付转化率","Order-Payment Conversion Rate",0, "yami.form.item.orderToPayRate"),

    /** 退款率 （退款订单数量/订单数量）*/
    REFUND_RATE(19,"退款率","Refund Rate",0, "yami.form.item.refundRate");

    private final Integer num;

    private final String name;

    private final String nameEn;

    /**
     * 0:通用，1：平台  2：商家端
     */
    private final Integer type;

    private final String i18nTag;

    public Integer value() {
        return num;
    }

    public String getName() {
        return name;
    }

    public String getNameEn() { return nameEn; }

    public Integer getType() {
        return type;
    }

    public String getI18nTag() {
        return i18nTag;
    }

    FormItemEnum(Integer num, String name, String nameEn, Integer type, String i18nTag){
        this.num = num;
        this.name = name;
        this.nameEn = nameEn;
        this.type = type;
        this.i18nTag = i18nTag;
    }

    public static FormItemEnum instance(Integer value) {
        FormItemEnum[] enums = values();
        for (FormItemEnum statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

    public static FormItemEnum[] allEnum() {
        return values();
    }
}
